<template>
	<view class="homeLayout">
		<view class="">
		</view>
		<view class="banner">
			<swiper circular indicator-dots indicator-color="rgba(255,255,255,0.5)" 
			indicator-active-color="#fff" autoplay>
				<swiper-item v-for="item in 3" >
					<image src="../../common/images/banner1.jpg" mode="aspectFill"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="notice">
			<view class="left">
				<uni-icons type="sound-filled" size="20" color="green"></uni-icons>
				<text>公告</text>
			</view>
			<view class="center">
				<swiper autoplay circular vertical >
					<swiper-item  v-for="(item,index) in notices" :key="notices.id">
						{{notices[index].notice}}
					</swiper-item>
				</swiper>
			</view>
			<view class="right">
				<uni-icons type="right" size="20" color="#909090"></uni-icons>
			</view>
		</view>
		<view class="select">
			<common-title>
				<template #name>
					每日推荐
				</template>
				<template #custom>
					<view class="date">
						<uni-icons type="calendar" size="30" color="#28b389"></uni-icons>
						<view class="text">
							<uni-dateformat :date="Date.now()" format="dd号"></uni-dateformat>
						</view>
					</view>
				</template>
			</common-title>
			<view class="content">
				<scroll-view scroll-x >
					<view class="box" v-for="item in 8">
						<image src="../../common/images/classify2.jpg" mode="aspectFill"></image>
					</view>
				</scroll-view>
			</view>
			<view class="theme">
				<common-title>
				<template #name>
					专题精选
				</template>
				<template #custom>
					<navigator url="" class="more">More+</navigator>
				</template>
			</common-title>
			
			<view class="content">
				<theme-item v-for="item in 8"></theme-item>
				<theme-item :isMore="true"></theme-item>
			</view>
			
			
			</view>
			
			
			
		</view>
	</view>
</template>

<script setup>
	
	import { ref } from 'vue';
	const notices=ref([
	{
		"id":1,
		"notice":"这是一条公告"
	},
	{
		"id":2,
		"notice":"重要通知"
	},
	{
		"id":3,
		"notice":"该产品还在开发中"
	}
	])
	const list=ref([
		{
			text: 'Grid 1',
			badge: '0',
			type: "primary"
		},
		{
			text: 'Grid 1',
			badge: '0',
			type: "primary"
		},
		{
			text: 'Grid 1',
			badge: '0',
			type: "primary"
		}
	])
</script>

<style lang="scss" scoped>
	.homeLayout{
		.banner{
			width: 750rpx;
			padding: 30rpx 0;
			swiper{
				width: 750rpx;
				height: 340rpx;
				&-item{
					width: 100%;
					height: 100%;
					padding: 0 30rpx;
					image{
						width: 100%;
						height: 100%;
						border-radius: 10rpx;
					}
				}
			}
		}
		.notice{
			height: 80rpx;
			width: 700rpx;
			background-color:#eeeeee;
			border-radius: 35rpx;
			//margin-right: 30rpx;
			margin-left: 30rpx;
		.notice:last-child{margin-right: 30rpx;}
			display: flex;
			align-items: center;
			.left{
				padding: 0 30rpx;
				display: flex;
				align-items: center;
				text{
					white-space: nowrap;
					display: flex;
					align-items: center;
				}
			}
			
			.center{
				height: 80rpx;
				width: 480rpx;
				color: #919191;
				padding: 0 10rpx;
				align-items: center;
				swiper{
					height: 80rpx;
					&-item{
						height: 80rpx;
						display: flex;
						align-items: center;
					}
				}
				
			}
			.right{
				display: flex;
				align-items: center;
			}
		}
		
		.select{
			width: 750rpx;
			padding-top: 60rpx;
			
			.date{
				color: #28b389;
				display: flex;
				align-items: center;
			}
			.content{
				width: 720rpx;
				margin-left: 30rpx;
				
				margin-top: 30rpx;
				scroll-view{
					white-space: nowrap;
					.box{
						width: 200rpx;
						height: 430rpx;
						display: inline-block;
						margin-right: 15rpx;
						image{
							width: 100%;
							height: 100%;
							border-radius: 12rpx;
						}
					}
					.box:last-child{margin-right: 30rpx;}
				}
			}
		}
		.theme{
			padding:50rpx 0;
			.more{
				font-size: 32rpx;
				color: #888;
			}
			.content{
				margin-top: 30rpx;
				padding: 0 30rpx;
				display: grid;
				gap: 15rpx;
				grid-template-columns:repeat(3,1fr) ;
			}
		}
	}
</style>
